Skip to content

ggml-hrx: fence global F32 output before Qwen Q8 packing - #174

Merged
AaronStGeorge merged 4 commits into
hrx-graph-develop-v2from
users/astgeorg/pr-qwen3-coder-q8-publication
Nov 3, 2026
Merged

AaronStGeorge merged 4 commits into
hrx-graph-develop-v2from
users/astgeorg/pr-qwen3-coder-q8-publication

Conversation

@AaronStGeorge

@AaronStGeorge AaronStGeorge commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Fence global F32 stores before the fused Qwen MoE normalization kernel reloads them for Q8 packing. Producer and packer workitems own different channel ranges; the existing workgroup-memory barrier does not order their global-memory accesses. This follows the same fix used for decode attention in #154.

The change replaces one barrier memory domain and documents why. It preserves the existing arithmetic and 32-byte LDS allocation.

Validation

On RX 7900 XTX (gfx1100), HRX 82214df, upstream base 930e43fe9, flash attention and F16 KV:

  • The retained model-trace checker fails on original captures and passes on six fresh fence-only captures. All 80 Q8 groups match canonical packing and repeat identically. The model-specific harness is retained as investigation evidence, outside this PR.
  • Qwen3-Coder 30B-A3B Q4_K_M full WikiText-2: 146 chunks, 149,358 scored tokens, 49/49 GPU layers. HRX PPL 8.1441 ± 0.06075; Vulkan 8.1470 ± 0.06078. All 146 printed HRX cumulative rows equal the previously validated shared-memory candidate.
  • Same-window five-repeat median pp256: fence 3589.39, shared-memory candidate 3589.78 tok/s (-0.011%). Median tg128: 223.994 vs 223.642 tok/s (+0.157%).
  • Qwen3-30B shared-consumer smoke: two-token prompt exercised the Q8 wrapper, twelve-token prompt exercised the F32 wrapper; each produced identical greedy output for two HRX runs and Vulkan. A separate one-token decode path did not select the changed wrapper and produced differing text; that result is excluded from the wrapper validation claim and remains unresolved.
  • Fence LDS 32 B, versus 8,224 B for the shared-memory candidate; SGPR24/VGPR54 for both.

Requirements

  • Contributing guidelines have been read by the agent; human review and acceptance remain pending for this draft.
  • AI usage disclosure: YES — Codex assisted with implementation, review, validation, and this PR description. Submitted as a draft for human review.

@AaronStGeorge AaronStGeorge changed the title ggml-hrx: fix fused Qwen MoE Q8 publication ggml-hrx: fence global F32 output before Qwen Q8 packing Nov 3, 2026
@AaronStGeorge
AaronStGeorge marked this pull request as ready for review November 3, 2026 19:10
@AaronStGeorge
AaronStGeorge merged commit f200667 into hrx-graph-develop-v2 Nov 3, 2026
0 of 6 checks passed
@AaronStGeorge
AaronStGeorge deleted the users/astgeorg/pr-qwen3-coder-q8-publication branch November 3, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant